package com.coolbi.onsupai.core.biz.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;

import com.coolbi.onsupai.core.biz.AccountFundBiz;
import com.coolbi.onsupai.core.dao.AccountFundDao;
import com.coolbi.onsupai.core.entity.AccountFund;
import com.coolbi.onsupai.core.exception.ServiceException;

public class AccountFundBizImpl implements AccountFundBiz {

	@Autowired
	private AccountFundDao accountFundDao;
	public void setAccountFundDao(AccountFundDao accountFundDao) {
		this.accountFundDao = accountFundDao;
	}

	
	@Override
	public AccountFund save(AccountFund obj) {
		try {
			accountFundDao.save(obj);
		} catch (Exception e) {
			throw new ServiceException("创建客户资金账户发生错误！", e);
		}
		return obj;
	}

	@Override
	public void delete(long id) {
		try {
			accountFundDao.delete(id);
		} catch (Exception e) {
			throw new ServiceException("删除客户资金账户发生错误！", e);
		}
	}

	@Override
	public void update(AccountFund obj) {
		try {
			accountFundDao.update(obj);
		} catch (Exception e) {
			throw new ServiceException("修改客户资金账户发生错误！", e);
		}
	}

	@Override
	public AccountFund get(long id) {
		return accountFundDao.get(id);
	}

	@Override
	public List<AccountFund> list() {
		return accountFundDao.list();
	}

	@Override
	public List<AccountFund> listByPage(int offset, int limit) {
		return accountFundDao.listByPage(offset, limit);
	}

	@Override
	public List<AccountFund> find(Map<String, Object> parameter) {
		return accountFundDao.find(parameter);
	}

	@Override
	public List<AccountFund> findByPage(Map<String, Object> parameter,
			int offset, int limit) {
		return accountFundDao.findByPage(parameter, offset, limit);
	}

	@Override
	public List<AccountFund> search(Map<String, Object> parameter, int offset,
			int limit) {
		return accountFundDao.search(parameter, offset, limit);
	}

	@Override
	public int count() {
		return accountFundDao.count();
	}

	@Override
	public int countByKeyWord(Map<String, Object> parameter) {
		return accountFundDao.countByKeyWord(parameter);
	}

	@Override
	public int count(Map<String, Object> parameter) {
		return accountFundDao.count(parameter);
	}

}